# Maintainer: David Runge <dave@sleepmap.de>
# Maintainer: Daniel M. Capella <polyzen@archlinux.org>
# Contributor: Carsten Feuls <archlinux@carstenfeuls.de>

_name=vobject
pkgname=python-vobject
pkgver=0.9.6.1
pkgrel=11
pkgdesc='Module for parsing and generating vCard and vCalendar files'
url="https://eventable.github.io/vobject/"
license=('Apache')
arch=('any')
depends=('python-dateutil')
makedepends=('python-build' 'python-installer' 'python-setuptools'
             'python-wheel')
source=("https://files.pythonhosted.org/packages/source/${_name::1}/${_name}/${_name}-${pkgver}.tar.gz")
sha256sums=('96512aec74b90abb71f6b53898dd7fe47300cc940104c4f79148f0671f790101')
b2sums=('74f9a7dc8058bb792492b1ac44a0310f58c603e677aedda35be0d8e94743e6e1e001a4ae888625f314f706891b7a31db77efa4c268482bbaf44ca37fff236cd6')

build() {
  cd "${_name}-${pkgver}"
  python -m build --wheel --skip-dependency-check --no-isolation
}

check() {
  cd "${_name}-${pkgver}"
  python tests.py
}

package() {
  cd "${_name}-${pkgver}"
  python -m installer --destdir="${pkgdir}" dist/*.whl
  install -vDm 644 {ACKNOWLEDGEMENTS.txt,README.md} \
    -t "${pkgdir}/usr/share/${pkgname}"
}
